#include <stdio.h>

void test1()
{
	char* str[3] = { "stra", "strb", "strc" };
	char* p = str[0]; //s
	printf("%s\n", p);
	int i = 0;
	while (i < 3)
	{
		printf("%s ", p++);
		i++;
	}
	printf("\n");
}


void test2()
{
	int m[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
	int(*p)[4] = (int(*)[4])m;
	printf("%d\n", p[1][2]); //7
}

void test3()
{
	char p1[15] = "abcd", * p2 = "ABCD", str[50] = "xyz";

	printf("%s %s ", str + 2, strcat(p1 + 2, p2 + 1));
	strcpy(str + 2, strcat(p1 + 2, p2 + 1));
	printf("%s\n", str);
}


char* f(char* str, char ch)
{
	char* it1 = str;
	char* it2 = str;
	while (*it2 != '\0')
	{
		while (*it2 == ch)
		{
			it2++;
		} *
			it1++ = *it2++;
	} 
	return str;
}
void test5()
{
	char a[10];
	strcpy(a, "abcdcccd");
	//printf("%s ", a);
	printf("%s\n", f(a, 'c'));
}


int main()
{
	test1();
	test2();
	test3();
	test5();

	return 0;
}


